package qingke.hibernate.bean;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "course")
public class Course {

	@Id
	@Column(name = "id")
	private int id;
	@Column(name = "code")
	private String code;
	@Column(name = "name")
	private String name;
	@Column(name = "description")
	private String description;

	@OneToMany
	@JoinColumn(name = "course_id")
	private Set<CourseSelect> courseSelect;

	@OneToMany
	@JoinColumn(name = "course_id")
	private Set<CourseTemplate> courseTemplate;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Set<CourseSelect> getCourseSelect() {
		return courseSelect;
	}

	public void setCourseSelect(Set<CourseSelect> courseSelect) {
		this.courseSelect = courseSelect;
	}

	public Set<CourseTemplate> getCourseTemplate() {
		return courseTemplate;
	}

	public void setCourseTemplate(Set<CourseTemplate> courseTemplate) {
		this.courseTemplate = courseTemplate;
	}

	@Override
	public String toString() {
		return "Course [id=" + id + ", code=" + code + ", name=" + name + ", description=" + description + "]";
	}
	
	
}
